package com.yuntian.mapper;

import com.github.pagehelper.Page;
import com.yuntian.Dto.CategoryPageQueryDto;
import com.yuntian.Dto.ProductPageQueryDto;
import com.yuntian.entity.Categories;
import com.yuntian.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {

    void deleteById(Integer id);

    void insertCategory(Categories category);

    void updateCategory(Categories categories);

    List<Categories> selectList();

    Page<Categories> categoryList(CategoryPageQueryDto categoryPageQueryDto);

    @Select("select count(*) from categories")
    Integer count();

    @Select("select * from categories where category_name = #{categoryName}")
    Categories selectByCategoryName(String categoryName);
}
